package com.atguigu.servicebase.exceptionhandler;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 自定义异常
 *
 * @author wangdan
 * @version 1.0
 * @date 2020/5/28 10:57
 */
@Data//生成get set方法
@AllArgsConstructor//有参构造器
@NoArgsConstructor//无参构造器
public class WdException extends RuntimeException {

    @ApiModelProperty(value = "状态码")
    private Integer code;

    private String msg;

    @Override
    public String toString() {
        return "WdException{" +
                "message=" + this.getMessage() +
                ", code=" + code +
                '}';
    }
}
